package com.tebiecloud.base.client.service;

import com.tebiecloud.base.client.model.UserAccount;
import com.tebiecloud.base.client.model.entity.BaseAccount;
import com.tebiecloud.base.client.model.entity.BaseUser;
import com.tebiecloud.common.model.ResultBody;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户管理
 * @Author: tebie
 * @Date: 2019-08-10 10:23
 */
public interface IBaseUserServiceClient {

    /**
     * 系统用户登录
     * @param username
     * @return
     */
    @PostMapping("/feign/user/infouseraccountforlogin")
    ResultBody<UserAccount> getUserAccountForLogin(@RequestParam(value = "username") String username,
                                                   @RequestParam(value = "password") String password,
                                                   @RequestParam(value = "type") String type);

    /**
     * 获取登录信息
     * @param account 账号
     * @param accountType 登录类型
     * @param domain 登录域
     * @return
     */
    @PostMapping("/feign/user/infoBaseAccount")
    ResultBody<BaseAccount> getBaseAccount(@RequestParam(value = "account") String account,
                                           @RequestParam(value = "accountType",required = false) String accountType,
                                           @RequestParam(value = "domain",required = false) String domain);

    /**
     * 更新账号
     * @param account
     * @param status
     * @return
     */
    @PostMapping("/feign/user/updateBaseAccount")
    ResultBody<BaseAccount> updateBaseAccount(@RequestParam(value = "account") String account,
                                              @RequestParam(value = "status") int status);

    /**
     * 添加登录账号
     * @param account 账号
     * @param password 明文密码
     * @param accountType 登录类型
     * @param domain 登录域
     * @param userDesc 用户描述
     * @param nickName 昵称
     * @param avatar 头像
     * @return
     */
    @PostMapping("/feign/user/addBaseAccount")
    ResultBody<BaseAccount> addBaseAccount(
            @RequestParam(value = "account") String account,
            @RequestParam(value = "password") String password,
            @RequestParam(value = "accountType") String accountType,
            @RequestParam(value = "domain") String domain,
            @RequestParam(value = "userDesc") String userDesc,
            @RequestParam(value = "nickName", required = false) String nickName,
            @RequestParam(value = "avatar", required = false) String avatar
    );

    /**
     * 获取用户基础信息
     * @param userId
     * @return
     */
    @PostMapping("/feign/user/infoBaseUser")
    ResultBody<BaseUser> infoBaseUser(@RequestParam(value = "userId") long userId);

    /**
     * 获取账户信息
     * @param accountId
     * @return
     */
    @PostMapping("/feign/user/getBaseAccountById")
    ResultBody<BaseAccount> getBaseAccountById(@RequestParam(value = "accountId") long accountId);

    /**
     * 获取账户
     * @param userId
     * @return
     */
    @PostMapping("/feign/user/getBaseAccountByUserId")
    ResultBody<BaseAccount> getBaseAccountByUserId(@RequestParam(value = "userId") long userId);
}
